package net.wanho.controller;

import lombok.RequiredArgsConstructor;
import net.wanho.dto.InStoreDTO;
import net.wanho.po.InStore;
import net.wanho.service.InStoreService;
import net.wanho.vo.AjaxResult;
import org.springframework.web.bind.annotation.*;

@RestController
@RequiredArgsConstructor
@RequestMapping("/instore")
public class InStoreController {
    private final InStoreService inStoreService;

    @GetMapping("/instore-page-list")
    public AjaxResult outstorePageList(@RequestParam(defaultValue = "1") Integer pageNum,
                                       @RequestParam(defaultValue = "5") Integer pageSize,
                                       InStoreDTO inStoreDTO) {
        return AjaxResult.success(inStoreService.findPageList(pageNum, pageSize, inStoreDTO));
    }
    @PutMapping("/instore-confirm")
    public AjaxResult instoreConfirm(@RequestBody InStore inStore) {
        inStoreService.instoreConfirm(inStore);
        return AjaxResult.success("入库成功！");
    }
}
